/**
 * Copyright (C) 2011, mordredd666 [_at_] gmail.com
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 *  
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *  
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */
package de.mordred.util;

public class Utility
{

	/**
	 * Converts given Seconds to HH:MM:SS
	 * 
	 * @param second
	 *            in seconds
	 * @return (HH:MM:SS)
	 */
	public static String convertSecondstoHHMMSS(int second)
	{

		int hours = Math.round(second / 3600);
		int minutes = Math.round((second / 60) % 60);
		int seconds = Math.round(second % 60);
		String hh = hours < 10 ? "0" + hours : "" + hours;
		String mm = minutes < 10 ? "0" + minutes : "" + minutes;
		String ss = seconds < 10 ? "0" + seconds : "" + seconds;

		return "(" + hh + ":" + mm + ":" + ss + ")";

	}
}
